#导入包
from hyperlpr import *
#导入OpenCV库
import cv2
# Flask
from flask import Flask,jsonify,request
app = Flask(__name__)


@app.route('/')
def hello():
	return 'HyperLPR'

# 识别车牌，post 方式提交文件地址过来
@app.route('/hyperlpr/',methods=['GET','POST'])
def hyperlpr():
	# 读入图片 request.form['username']
	imgPath = request.form['path'];
	demoImg = cv2.imread(imgPath)
	# 识别结果
	res = HyperLPR_PlateRecogntion(demoImg)
	return jsonify(res)